<template>
  <el-form ref="form" class="setting-form" :model="form" label-width="80px">
    <el-form-item label="企业名称">
      <el-input v-model="form.name" disabled />
    </el-form-item>
    <el-form-item label="公司地址">
      <el-input v-model="form.companyAddress" disabled />
    </el-form-item>
    <el-form-item label="公司电话">
      <el-input v-model="form.companyPhone" disabled />
    </el-form-item>
    <el-form-item label="邮箱">
      <el-input v-model="form.mailbox" disabled />
    </el-form-item>
    <el-form-item label="备注">
      <el-input v-model="form.remarks" disabled />
    </el-form-item>
  </el-form>
</template>

<script>
import { getCompanyById } from '../../../api/setting'

// 导入辅助函数
import { mapGetters } from 'vuex'
export default {
  name: 'SettingForm',
  data() {
    return {
      // 表单
      form: {}
    }
  },
  //  计算属性
  computed: {
    ...mapGetters(['userInfo'])
  },
  //   生命周期钩子
  async created() {
    const res = await getCompanyById(this.userInfo.companyId)
    this.form = res
    // console.log('res:', res)
  }
}
</script>

<style lang="scss">
.setting-form {
  width: 600px;
  margin-top: 30px;
}
</style>
